Need to catch the exit code, handle the Error based on the exit code.
Use %ErrorLevel% – Almost all applications will set an exit code when complete (by conversion, 0 means successful).
Example 1:
copy file1.txt file3.txt
ECHO ...%ErrorLevel%
copy fileNotExisting.txt f.txt
ECHO %ErrorLevel%
Output:
“1 file(s) copied”
0
“The system cannot find the file specified.”
1
Example 2:
SET SSIS_EXIT_CODE=%ErrorLevel%
copy "%PKG_PATH%\Logs\….dtsx.log" ..
IF %SSIS_EXIT_CODE% NEQ 0 (
EXIT /B %SSIS_EXIT_CODE%
)
Links:
http://ss64.com/nt/errorlevel.html
http://ss64.com/nt/exit.html
How to check the exit code of the last command in batch file?
Apache Flex 4.9.0 Released! Apache 发布Flex 4.9 <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.